<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>09-flex子项align-self与order</title>
  <style>
    div {
      /* 给父级添加flex布局属性才能够控制子元素哦 */
      display: flex;

      /* 让所有子元素盒子全部沿着侧轴底部排列 */
      /* align-items: flex-end; */

      width: 80%;
      height: 300px;
      margin: 0 auto;
      background-color: pink;
    }

    div span {
      width: 150px;
      height: 100px;
      margin: 10px;
      background: skyblue;
    }

    div span:nth-child(3) {
      /* 单独设置某一个盒子沿着侧轴的对齐方式 */
      align-self: flex-end;
    }

    div span:nth-child(7) {
      /* 默认是0 越小越靠前 */
      order: -1;
    }
  </style>
</head>

<body>
  <div>
    <span>1</span>
    <span>2</span>
    <span>3</span>
    <span>4</span>
    <span>5</span>
    <span>6</span>
    <span>7</span>
    <span>8</span>
  </div>

</body>

</html>